package ui;

import javax.swing.JLabel;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;

public class BorderLabel extends JLabel {
	private static final long serialVersionUID = 1L;
	private Border border;
	private Border dborder;

	public BorderLabel() {
		
	}

	public BorderLabel(Border enabledBorder, Border disabledBorder, boolean enabled) {
	    Border empty = new EmptyBorder(0,5,0,0);
		Border border = new CompoundBorder(enabledBorder,empty);
		Border dborder = new CompoundBorder(disabledBorder,empty);
		this.border = border;
		this.dborder = dborder;
		
		this.setBorder(enabled ? border : dborder);
		
	}
	
	@Override
	public void setEnabled(boolean enabled) {
		this.setBorder(enabled ? border : dborder);
		super.setEnabled(enabled);
	}	
}
